//
//  MJLottieView.swift
//  PassionPulse
//
//  Created by kyo on 2024/2/5.
//

import UIKit
import Lottie
@objcMembers class MJLottieView: LottieAnimationView {
    
    func defultSet(name: String) {
        let  animation = LottieAnimation.named(name,animationCache: DefaultAnimationCache.sharedCache)
        self.animation = animation
        self.loopMode = .loop
        self.animationSpeed = 1.0
    }
    
    func stopAnimation() {
        self.stop()
    }
    
    func startAnimation() {
        self.currentProgress = 0;
        self.play()
    }
    
    func resetProgress(progress: CGFloat) {
        self.currentProgress = progress;
    }
}
